<?php
	session_start();
	/*
		Find user
	*/
	function login($found)
	{
		$_SESSION["user_id"] = mysql_result($found, 0, 0);
		$_SESSION["user_name"] = mysql_result($found, 0, 1);
		$_SESSION["groupUser"] = mysql_result($found, 0, 3);
		$_SESSION["full_name"] = mysql_result($found, 0, 4);
	}
	function isLoggedIn()
	{
		if(isset($_SESSION["user_id"]))
			return true;
		else
			return false;
	}
	function getUserId()
	{
		return $_SESSION["user_id"];
	}
	function getUserName()
	{
		return $_SESSION["user_name"];
	}
	function getUserFullName()
	{
		return $_SESSION["full_name"];
	}
	
	function getGroupUser()
	{
		return $_SESSION["groupUser"];
	}
	function logout()
	{
		if(isset($_SESSION["user_id"]))
		{
			unset($_SESSION["user_id"]);
			unset($_SESSION["user_name"]);
		}
	}
	/*
		Find Member
	*/
	function memberLogin($found)
	{
		$_SESSION["mem_id"] = mysql_result($found, 0, 0);
		$_SESSION["login_name"] = mysql_result($found, 0, 1);
		$_SESSION["photo"] = mysql_result($found, 0, 3);
		$_SESSION["is_log"] = mysql_result($found, 0, 4);
	}
	function isMemberLogin()
	{
		if(isset($_SESSION["mem_id"]))
			return true;
		else
			return false;
	}
	function getMemberId()
	{
		return $_SESSION["mem_id"];
	}
	function getMemberName()
	{
		return $_SESSION["login_name"];
	}

	function memberLogout()
	{
		if(isset($_SESSION["mem_id"]))
		{
			unset($_SESSION["mem_id"]);
			unset($_SESSION["login_name"]);
		}
	}
		
?>